//
//  WCDayModel.m
//  WC
//
//  Created by wsj2015 on 15/9/18.
//  Copyright (c) 2015年 ShanghaiCize Trade And Business Co., Ltd. All rights reserved.
//

#import "WCDayModel.h"
#import "WCDateMdoel.h"
@implementation WCDayModel

-(NSArray *)dateArray
{
    if (!_dateArray) {
        return nil;
    }
    return [self sortedTimeProid:_dateArray];

}


//按照日期排序
- (NSArray *)sortedTimeProid:(NSArray *)array
{
    NSMutableArray *mulArr =[NSMutableArray arrayWithArray:array];
    for (int i =0 ; i<array.count; i++) {
        for (int j =  i+1; j<array.count; j ++) {
            WCDateMdoel *model1 =array[i];
            WCDateMdoel *model2 =array[j];
            if ([model1.timePeriodId integerValue] > [model2.timePeriodId integerValue]) {
                [mulArr exchangeObjectAtIndex:i withObjectAtIndex:j];
            }
        }
    }
    array = mulArr;
    return array;
    
}


@end
